package com.draven.order.feign;

import com.draven.model.product.ProductDTO;
import com.draven.order.feign.fallback.ProductFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(value = "spring-cloud-service-product", fallback = ProductFeignClientFallBack.class)
public interface ProductFeignClient {
    @RequestMapping("/product/getProduct/{id}")
    String getProduct(@PathVariable("id") Long id);

    @RequestMapping("/product/updateStock/{id}/{num}")
    void updateStock(@PathVariable("id") Long id, @PathVariable("num") Integer num);

    @RequestMapping("/product/page")
    List<ProductDTO> productPage();

    @RequestMapping("/product/detail/{id}")
    ProductDTO getProductDetail(@PathVariable("id") Long id);
}
